//
//  XMGTextField.m
//  百思不得姐
//
//  Created by 杨庆 on 2017/1/6.
//  Copyright © 2017年 杨庆. All rights reserved.
//

#import "XMGTextField.h"
#import <objc/runtime.h>
@implementation XMGTextField

-(void)awakeFromNib{
	//光标颜色
	self.tintColor=[UIColor whiteColor];
	[super awakeFromNib];
	[self resignFirstResponder];
}


-(BOOL)resignFirstResponder{
	//失焦文字颜色
	[self setValue:[UIColor grayColor] forKeyPath:@"_placeholderLabel.color"];
	
	return [super resignFirstResponder];
}

-(BOOL)becomeFirstResponder{
	//聚焦文字颜色
	[self setValue:[UIColor whiteColor] forKeyPath:@"_placeholderLabel.color"];
	
	return [super becomeFirstResponder ];
}
@end
